//
// Created by 吴锐 on 2022/2/23.
//

#include<iostream>

using namespace std;

class Person{
private:
    string m_Name;
    int m_Age = 0;
    string m_Lover;

public:
    void setName(string name){
        m_Name = name;
    }

    string getName(){
        return m_Name;
    }

    void setAge(int age){
        if(age > 0 && age <= 150){
            m_Age = age;
        }else {
            cout << "您输入的年龄有误!" << endl;
            m_Age = 0;
        }
    }

    int getAge(){
        return m_Age;
    }

    void setLover(string lover){
        m_Lover = lover;
    }

    string getLover(){
        return m_Lover;
    }
};

int main(){
    Person p1;
    p1.setName("张三");
    cout << "姓名: " << p1.getName() << endl;
    p1.setAge(1000);
    cout << "年龄: " << p1.getAge() << endl;
    p1.setLover("苍井");
    cout << "情人为: " << p1.getLover() << endl;
    return 0;
}